home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
maksiu
/
lists
/
amoslist-1295.lzh
/
AMOSLIST
/
000037_comlink.mpx.co…et!amos-request_Thu, 25 May 95.msg
< prev
next >
Wrap
Text File
|
1995-12-31
|
4KB
|
94 lines
04:48:15 1100
Date: Wed, 24 May 1995 04:21:54 -0400 (EDT)
Message-Id: <Pine.SUN.3.91.950524022739.25511A-100000@mothra.syr.edu>
From: Tim Wright <tewright@mailbox.syr.edu>
Subject: Re: point and Ham
On Tue, 23 May 1995, Robert Currie wrote:
> The way HAM works is that the first pixel of every line defines a
> color. The pixel beside it changes only one aspect of that color, either
the
> red, green or blue aspect. This pattern is repeated across the entire
line
> of the graphics screen, each pixel only containing the change in one
aspect
pf
> the color. By getting the pixel color, you are really only getting the
value
> of the change in one aspect of the previouse color. To calculate the
color
you
> must actually apply the changes made to the first pixel of the line up to
and
> including the pixel in question. I am not sure of the exact form of the
changes
> as in which change goes in which order(I think it is Red then Green then
Blue)
> but I am sure someone could supply you with that information.
> Robert Currie
HAM mode uses a base of 16 colors. AMOS treats these like the colors of
any ordinary 16 color screen. A color index value of 0-15 in AMOS
functions refers to one of these base colors.
HAM stands for 'Hold And Modify'. To display its thousands of colors,
HAM 'Holds' the value of a pixel and allows you to 'Modify' the red, green,
or blue value of the pixel to the right of it. Color index values 16-63
refers to the value the previous pixel is modified by:
values 16-31: replace previous BLUE value (new intensity=value-16)
values 32-47: replace previous RED value (new intensity=value-32)
values 48-63: replace previous GREEN value (new intensity=value-48)
Example:
Color 1,$fff <- set index 1 to all white
Plot 1,1,1 <- plot white pixel on screen
Plot 2,1,50 <- modifies the green value of the previous pixel to
a
very dim value. This second pixel will be very
magenta.
So... If you are trying to find the RGB value of a point on a HAM screen,
its a tad messy. You have to keep checking points to the left until you
find a base color; reach the beginning of the line; or come across a
modified red, green, and blue value. Here's a rough outline that sould
work:
CHECK THE CURRENT POINT
if it has index value 0-15
use the colour function to get the RGB value
if this is not your first check
modify with the value(s) you are keeping track of
DONE
else
if you are not keeping track of this color already
remember the modified color and intensity
if you are now keeping track of a red, green, and blue value
use this value with the other ones you have
DONE
if this is the first horizontal pixel
use the value(s) you have, and use 0 for the missing one(s)
DONE
else
move one pixel to the left, and GO BACK TO THE BEGINNING
I did once write a recursive procedure that did this but it was painfully
slow and I deleted it. :}
-======}=* Tim Wright - "Argh!" - tewright@mailbox.syr.edu
*={======-
Hope this helps.
Darryl
-- Via DLG Pro v1.0
#####\ _ /#####
#( )# | _( )__ | #( )#
##### | /_ / | #####
#" "# | ___m/I_ //_____ | #" "#
# O # |____#-x.\ /++m\ /.x-#____| # O #
#m.m# | /" \ ///###\\\ / "\ | #m.m#
#####/ ######/ \###### \#####